package com.nzw.vo.common;

import java.io.Serializable;

/**
 * Created by 许湛司 on 2017/4/27.
 * 通用的返回前端AJAX数据展示
 */
public class HttpResult implements Serializable {
    public static final int OK = 200;//成功访问
    public static final int NOT_FOUND = 404;//找不到资源
    public static final int DATA_ERROR=401;//接收到的数据错误
    public static final int SERVER_ERROR=500;//服务器操作错误
    public static final int NULL = 801;         //查询为空
    public static final int SMS_FALSE = 802;     //短信发送失败
    public static final int PAY_FALSE = 803;    //支付失败
    public static final int LOGIN_OVERTIME = 804;    //登录过期
    public static final int ORDER_OVER = 805;    //登录过期




    public static final int ACCOUNT_EXIST=600;//账号已存在
    public static final int VERIFY_CODE_ERROR=601;//验证码错误
    public static final int NEEDTO_REGIST_ORG=604;//需要进行注册企业
    public static final int NEEDTO_SET_PUBLIC_SIGNAL=605;//需要进行设置公众号

    private int code;
    private String msg;// 提示信息
    private Object obj = null;// 其他信息

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
    public void setResult(int code,Object obj){
        this.code=code;
        this.obj=obj;
    }

    public HttpResult(int code, Object obj) {
        this.code = code;
        this.obj = obj;
    }
    public HttpResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public HttpResult() {
    }

    public HttpResult(int code) {
        this.code=code;
    }

    @Override
    public String toString() {
        return "HttpResult{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", obj=" + obj +
                '}';
    }
}
